//
//  HotelItem.m
//  MiaoTu
//
//  Created by dllo on 16/09/20
//  Copyright (c) dllo. All rights reserved.
//

#import "HotelItem.h"
#import "Imagelist.h"
#import "Yueyoulist.h"
#import "Resgps.h"
#import "Prolist.h"
#import "Resfacilities.h"
#import "Yueyou.h"

@implementation HotelItem

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"ResGPS"]) {
        NSMutableArray<Resgps *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Resgps *model = [Resgps modelWithDic:dic];
            [array addObject:model];
        }
        _ResGPS = array;
    }
    if ([key isEqualToString:@"ResFacilities"]) {
        NSMutableArray<Resfacilities *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Resfacilities *model = [Resfacilities modelWithDic:dic];
            [array addObject:model];
        }
        _ResFacilities = array;
    }
    if ([key isEqualToString:@"ImageList"]) {
        NSMutableArray<Imagelist *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Imagelist *model = [Imagelist modelWithDic:dic];
            [array addObject:model];
        }
        _ImageList = array;
    }
    if ([key isEqualToString:@"ProList"]) {
        NSMutableArray<Prolist *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Prolist *model = [Prolist modelWithDic:dic];
            [array addObject:model];
        }
        _ProList = array;
    }
    if ([key isEqualToString:@"Yueyou"]) {
        _Yueyou = [Yueyou modelWithDic:value];
    }
    if ([key isEqualToString:@"YueyouList"]) {
        NSMutableArray<Yueyoulist *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Yueyoulist *model = [Yueyoulist modelWithDic:dic];
            [array addObject:model];
        }
        _YueyouList = array;
    }
}

+ (NSDictionary *)objectClassInArray{
    return @{@"ImageList" : [Imagelist class], @"YueyouList" : [Yueyoulist class], @"model" : [Resgps class], @"ProList" : [Prolist class], @"ResFacilities" : [Resfacilities class]};
}

@end
